
package com.huaweicloud.saaslanding.install.properties;

import static com.huaweicloud.saaslanding.install.constant.ModelConstant.IAM_PREFIX;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

/**
 * IAM 初始数据
 *
 * @since 2022-03-18
 */
@EqualsAndHashCode
@Data
@AllArgsConstructor
@NoArgsConstructor
@Component
@Validated
@ConfigurationProperties(prefix = IAM_PREFIX)
public class Iam {
    /**
     * IAM 用户所属帐号ID
     */
    @NotEmpty(message = "IAM用户所属帐号ID(iam.iamDomainId)不能为空")
    private String iamDomainId;

    /**
     * IAM 用户所属帐号名
     */
    @NotEmpty(message = "IAM用户所属帐号名(iam.iamDomain)不能为空")
    private String iamDomain;

    /**
     * IAM 用户名
     */
    @NotEmpty(message = "IAM用户名(iam.iamUser)不能为空")
    private String iamUser;

    /**
     * IAM 密码
     */
    @NotEmpty(message = "IAM密码(iam.iamPassword)不能为空")
    private String iamPassword;

    /**
     * 区域
     */
    @NotEmpty(message = "区域(iam.region)不能为空")
    private String region;

    /**
     * 区域项目id
     */
    @NotEmpty(message = "IAM区域项目id(iam.projectId)不能为空")
    private String projectId;

    /**
     * AK
     */
    @NotEmpty(message = "IAM-AK(iam.accessKey)不能为空")
    private String accessKey;

    /**
     * SK
     */
    @NotEmpty(message = "IAM-SK(iam.secretKey)不能为空")
    private String secretKey;

    /**
     * 云商店接入码
     */
    @NotEmpty(message = "cloudMarketAccesskey不能为空")
    private String cloudMarketAccesskey;

    /**
     * 企业项目id
     */
    @NotEmpty(message = "enterpriseProjectId不能为空")
    private String enterpriseProjectId;

    /**
     * IAM服务端点
     */
    @NotBlank(message = "IAM服务端点(iam.endpoint)不能为空")
    private String endpoint;
}
